import request from '@/utils/request'

// 查询代理商
export function medicalRepresentativeList(query) {
  return request({
    url: '/base/medicalRepresentative/list',
    method: 'get',
    params: query,
  })
}
// 新增代理商
export function addMedicalRepresentative(data) {
  return request({
    url: '/base/medicalRepresentative',
    method: 'post',
    data: data,
    parm: {
      isDeleted: 0,
      status: 6
    },
  })
}


// 获取代表详细信息
export function medicalRepresentativeId(id) {
  return request({
    url: `/base/medicalRepresentative/${id}`,
    method: 'get',
  })
}


// 修改代表
export function eitHmedicalRepresentative(data) {
  return request({
    url: '/base/medicalRepresentative',
    method: 'put',
    data: data
  })
}

// 删除医药代表
export function delMedicalRepresentative(id) {
  return request({
    url: `/base/medicalRepresentative/${id}`,
    method: 'delete'
  })
}

// 启用医药代表
export function delMedicalRepresentativeenable(id) {
  return request({
    url: `/base/medicalRepresentative/enable/${id}`,
    method: 'post'
  })
}

// 审核代理商实名认证
export function auditAuth(query) {
  return request({
    url: '/base/medicalRepresentative/audit-auth',
    method: 'get',
    params: query
  })
}


// 医药代表已激活
export function medicalRepresentativeactive(query) {
  return request({
    url: '/base/medicalRepresentative/active',
    method: 'get',
    params: query
  })
}



export function agreementlistByMr() {
  return request({
    url: `/base/agreement/list-by-mr`,
    method: 'get',
  })
}


// 驳回医药代表实名认证
export function refuseauth(query) {
  return request({
    url: '/base/medicalRepresentative/refuse-auth',
    method: 'get',
    params: query
  })
}

// 医药代表状态改为已驳回协议
export function medicalRepresentativeBh(query) {
  return request({
    url: '/base/medicalRepresentative/refuse',
    method: 'get',
    params: query
  })
}   

// 代表签订协议
export function addAgreement(query) {
  return request({
    url: '/base/medicalRepresentative/edit-agreement',
    method: 'post',
    data: query
  })
}